package com.inspur.edp.paasuser.rest;

import com.inspur.edp.paasuser.SynchronizationInfoService;
import com.inspur.edp.paasuser.dto.SynchqronizationInfoDto;
import io.iec.edp.caf.commons.utils.SpringBeanUtils;
import io.iec.edp.caf.sysmanager.api.data.user.User;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class SynchronizationInfoController {
    SynchronizationInfoService synchronizationInfoService = SpringBeanUtils.getBean(SynchronizationInfoService.class);
    @POST
    @Path(value = "/adduser")
    public void addUser(SynchqronizationInfoDto synchqronizationInfoDto){
        synchronizationInfoService.addUser(synchqronizationInfoDto);
    }

    @POST
    @Path(value = "/addteamtser")
    public void addTeamUser(SynchqronizationInfoDto synchqronizationInfoDto){
        synchronizationInfoService.addTeamUser(synchqronizationInfoDto);
    }

    @GET
    @Path(value = "/userswitch")
    public void userSwitch(SynchqronizationInfoDto synchqronizationInfoDto){
        synchronizationInfoService.userSwitch(synchqronizationInfoDto);
    }

    @POST
    @Path(value = "/adduserreceive")
    public void addUserReceive(User user){
        synchronizationInfoService.addUserReceive(user);
    }

    @GET
    @Path(value = "/checkenvironment")
    public String checkEnvironment(){
        return synchronizationInfoService.checkEnvironment();
    }
    @GET
    @Path(value = "/saveenvironment")
    public String saveEnvironment(){
        return synchronizationInfoService.saveEnvironment();
    }
}
